//
//  LTCurlRequestEx.hpp
//  LeTVCocos2d
//
//  Created by jeason on 16/7/25.
//  Copyright © 2016年 letv. All rights reserved.
//

#ifndef LTCurlRequestEx_hpp
#define LTCurlRequestEx_hpp

#include <stdio.h>
#include <set>
#include <mutex>
#include "LTHttpOperation.h"
#include "LTOperationManager.h"

class LTCurlRequestEx {
public:
    ~LTCurlRequestEx();
    
public:
    static LTCurlRequestEx *autoReleasedRequest();
    long get(const char *url,
             long timeout,
             map<string, string> *header,
             char *proxy,
             void *context,
             std::function<void(void*,size_t,bool,long)> callc);
    
public:
    LTHttpOperation *operation;
    std::function<void(void*, size_t, bool, long requestId)> callbackFunction;
    
    
private:
     LTCurlRequestEx();
};

#endif /* LTCurlRequestEx_hpp */